Ref and sink the column. (gtk_combo_box_menu_destroy): Unref the column.
authorMatthias Clasen <maclas@gmx.de>
Mon, 9 Aug 2004 03:39:06 +0000 (03:39 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 9 Aug 2004 03:39:06 +0000 (03:39 +0000)
Sun Aug  8 23:36:55 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkcombobox.c (gtk_combo_box_menu_setup): Ref
and sink the column.
(gtk_combo_box_menu_destroy): Unref the column.

Sun Aug  8 23:35:00 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkdnd.c (gtk_drag_source_add_text_targets):
(gtk_drag_dest_add_text_targets): Don't leak a reference
to the target list.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcombobox.c
gtk/gtkdnd.c

index ba68a31ebebe795d43d8e2fd500f12d0854337d0..c7453468f91082caf975fa7367761b83125e71ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Sun Aug  8 23:36:55 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_menu_setup): Ref
+       and sink the column.
+       (gtk_combo_box_menu_destroy): Unref the column.
+
+Sun Aug  8 23:35:00 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkdnd.c (gtk_drag_source_add_text_targets): 
+       (gtk_drag_dest_add_text_targets): Don't leak a reference 
+       to the target list.
+
 Sun Aug  8 22:52:26 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombobox.c (find_menu_by_path): Don't stumble over
index ba68a31ebebe795d43d8e2fd500f12d0854337d0..c7453468f91082caf975fa7367761b83125e71ff 100644 (file)
@@ -1,3 +1,15 @@
+Sun Aug  8 23:36:55 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_menu_setup): Ref
+       and sink the column.
+       (gtk_combo_box_menu_destroy): Unref the column.
+
+Sun Aug  8 23:35:00 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkdnd.c (gtk_drag_source_add_text_targets): 
+       (gtk_drag_dest_add_text_targets): Don't leak a reference 
+       to the target list.
+
 Sun Aug  8 22:52:26 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombobox.c (find_menu_by_path): Don't stumble over
index ba68a31ebebe795d43d8e2fd500f12d0854337d0..c7453468f91082caf975fa7367761b83125e71ff 100644 (file)
@@ -1,3 +1,15 @@
+Sun Aug  8 23:36:55 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_menu_setup): Ref
+       and sink the column.
+       (gtk_combo_box_menu_destroy): Unref the column.
+
+Sun Aug  8 23:35:00 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkdnd.c (gtk_drag_source_add_text_targets): 
+       (gtk_drag_dest_add_text_targets): Don't leak a reference 
+       to the target list.
+
 Sun Aug  8 22:52:26 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombobox.c (find_menu_by_path): Don't stumble over
index ba68a31ebebe795d43d8e2fd500f12d0854337d0..c7453468f91082caf975fa7367761b83125e71ff 100644 (file)
@@ -1,3 +1,15 @@
+Sun Aug  8 23:36:55 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_menu_setup): Ref
+       and sink the column.
+       (gtk_combo_box_menu_destroy): Unref the column.
+
+Sun Aug  8 23:35:00 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkdnd.c (gtk_drag_source_add_text_targets): 
+       (gtk_drag_dest_add_text_targets): Don't leak a reference 
+       to the target list.
+
 Sun Aug  8 22:52:26 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombobox.c (find_menu_by_path): Don't stumble over
index 535b32538cc8c65850c2ba7189dcca7bbf8d9112..a146b01b2059dae903263add24cd722dc2b20fb6 100644 (file)
@@ -2279,6 +2279,8 @@ gtk_combo_box_menu_setup (GtkComboBox *combo_box,
 
   /* the column is needed in tree_column_row_is_sensitive() */
   combo_box->priv->column = gtk_tree_view_column_new ();
+  g_object_ref (combo_box->priv->column);
+  gtk_object_sink (GTK_OBJECT (combo_box->priv->column));
   gtk_combo_box_sync_cells (combo_box, 
                            GTK_CELL_LAYOUT (combo_box->priv->column));
 }
@@ -2427,6 +2429,9 @@ gtk_combo_box_menu_destroy (GtkComboBox *combo_box)
   combo_box->priv->arrow = NULL;
   combo_box->priv->separator = NULL;
 
+  g_object_unref (combo_box->priv->column);
+  combo_box->priv->column = NULL;
+
   /* changing the popup window will unref the menu and the children */
 }
 
@@ -4301,6 +4306,7 @@ gtk_combo_box_set_active_iter (GtkComboBox     *combo_box,
 
   path = gtk_tree_model_get_path (gtk_combo_box_get_model (combo_box), iter);
   gtk_combo_box_set_active_internal (combo_box, path);
+  gtk_tree_path_free (path);
 }
 
 /**
index 0f32280ba493deb9bcc993d9c5a672f8a02f5174..acdb9212fd861b915ae123a1126b381bdbf96493 100644 (file)
@@ -1039,10 +1039,13 @@ gtk_drag_dest_add_text_targets (GtkWidget *widget)
   GtkTargetList *target_list;
 
   target_list = gtk_drag_dest_get_target_list (widget);
-  if (!target_list)
+  if (target_list)
+    gtk_target_list_ref (target_list);
+  else
     target_list = gtk_target_list_new (NULL, 0);
   gtk_target_list_add_text_targets (target_list);
   gtk_drag_dest_set_target_list (widget, target_list);
+  gtk_target_list_unref (target_list);
 }
 
 /*************************************************************
@@ -2203,10 +2206,13 @@ gtk_drag_source_add_text_targets (GtkWidget *widget)
   GtkTargetList *target_list;
 
   target_list = gtk_drag_source_get_target_list (widget);
-  if (!target_list)
+  if (target_list)
+    gtk_target_list_ref (target_list);
+  else
     target_list = gtk_target_list_new (NULL, 0);
   gtk_target_list_add_text_targets (target_list);
   gtk_drag_source_set_target_list (widget, target_list);
+  gtk_target_list_unref (target_list);
 }
 
 static void